
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="${BASE_PATH}/static/css/common.css"/>
<link rel="stylesheet" type="text/css" href="${BASE_PATH}/static/css/dl.css"/>
<link rel="stylesheet" type="text/css" href="${BASE_PATH}/static/css/manage.css"/>
<script type="text/javascript" src="${BASE_PATH}/static/js/jquery.js"></script>
<script type="text/javascript" src="${BASE_PATH}/static/js/jquery.pagination.js"></script>
<script src="${BASE_PATH}/static/js/jquery.lightbox_me.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="${BASE_PATH}/static/js/jquery.form.js"></script>		
<script type="text/javascript">
$(document).ready(function() {
	$("#Pagination").pagination("15");
});


	function AjaxSubmit(vKeyID)
	{
    	var cValue =$("#form_"+vKeyID).formSerialize();
    	var vID="";
    	if(vKeyID!="1")
    	{
    		vID=vKeyID;
    	}
    	
        $.ajax({
            type: "POST",
            url: "${BASE_PATH}/services/sys_org_save?id="+vID,
			dataType : "json",
			cache : false,
			data : cValue + "&no-cache=" + Math.round(Math.random() * 10000),
			success : onAfterSubmit
		});
	}
	
	function AjaxDelete(vKeyID)
	{
        $.ajax({
            type: "POST",
            url: "${BASE_PATH}/services/sys_org_delete?id="+vKeyID,
			dataType : "json",
			cache : false,
			data : "no-cache=" + Math.round(Math.random() * 10000),
			success : onAfterSubmit
		});
	}
	function onAfterSubmit(ret) {
		//保存成功
		if (ret.Code == 1) {
			alert("数据保存成功！");
			window.location.reload();
			return;
		}

		if (ret.Code == 2) {
			alert("用户登录失败！");
			return;
		}

		//验证失败
		if (ret.Code == 3) {
			var vCtrlID = ret.ctrlID;
			var vMessage = ret.message;
			$("#" + vCtrlID).focus();
			alert(vMessage);
			return;
		}
	}		
</script>
<title>机构信息管理</title>
</head>
<body>
<!--head start-->
<#include "../common/myspacetop.ftl"/> 
<!--head end-->
<div class="fnav system_fnav">
   <ul>
      <li><a href="###" target="_top">首页</a></li>
      <li><span>></span></li>
      <li><a href="###" target="_top">我的预约</a></li>
      <li><span>></span></li>
      <li><a href="###" target="_top">所有预约</a></li>
   </ul>   
</div>
<div class="my-content">
   <#include "../common/left.ftl"/> 
   <div class="coright"> 
      <h2 class="my-bt"><span>新增机构信息</span></h2>
      <div class="coright1">
         <form id="form_1" action="###" method="post">
            <div class="name"><span>单位名称:</span><input type="text" name="org_name" /></div>
            <div class="name"><span>单位地址:</span><input type="text" name="org_addr" /></div>
            <div class="name"><span>单位简介:</span><textarea  name="org_desc"></textarea></div>
            <div class="coright1_button"><a href="###" onclick="AjaxSubmit('1');">保存</a><input type="reset" value="重置"/></div>
         </form>  
      </div>
      <h2 class="my-bt"><span>机构信息管理</span></h2>
      <#list dbrows as rowkey>
      <form id="form_${rowkey.id}" action="###" method="post">
      <div class="coright_list">
         <div class="coright_listc">
            <div class="coright_listcl">
               <img src="${BASE_PATH}/static/images/all_18.jpg" />
            </div>
            <div class="coright_listcr">
               <div class="coright_listcrt">
                <dl class="coright_dltop">
                   <dt class="jc"><span class="jcname">单位名称:</span><span class="jccon"><input type="text" name="org_name" value="${rowkey.org_name!""}"/></span></dt>
                   <dd class="jc"><span class="jcname">单位地址:</span><span class="jccon"><input type="text" name="org_addr" value="${rowkey.org_addr!""}"/></span></dd>
                   <dd class="zyj"><span class="jcname">单位简介:</span><span class="jccon"><textarea  name="org_desc">${rowkey.org_desc!""}</textarea></span></dd>
                </dl>
                <div class="insert"><a href="###" class="xg delate"  onclick="AjaxDelete('${rowkey.id}');">删除</a><a href="###" class="xg bc"  onclick="AjaxSubmit('${rowkey.id}');">保存</a></div>
                <div class="clear"></div>
                </div>
            </div>
         </div>
        <div class="clear"></div>
      </div> 
      </form>
      </#list>
   </div>
</div>
<div class="clear"></div>
<div class="pages">
        <div id="Pagination"></div>
        <div class="searchPage">
          <span class="page-sum">共<strong class="allPage">15</strong>页</span>
          <span class="page-go">跳转<input type="text">页</span>
          <a href="javascript:;" class="page-btn">GO</a>
        </div>
        <div class="clear"></div>
</div>   
</body>
</html>
